Skip to content

feat: add builder system transactions #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

marktoda
Copy link
Collaborator

Pull Request

Description

Please include a summary of the change and which feature was implemented or which issue was fixed. Also, include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Checklist:

Before deployment

  • 100% test and branch coverage
  • check slither for severe issues
  • fuzz and invariant tests (when applicable)
  • formal verification (when applicable)
  • deployment or upgrade scripts ready

After deployment

  • transfer ownership after deployments (when applicable)
  • complete upgrade (when applicable)
  • generate deployment/upgrade log files

Considerations

  • I have followed the contributing guidelines.
  • My code follows the style guidelines of this project and I have run forge fmt and prettier to ensure the code style is valid
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional context

Add any other context about the pull request here.

Copy link

github-actions bot commented Sep 19, 2024

Forge code coverage:

File % Lines % Statements % Branches % Funcs
src/BuilderSystemTransactions.sol 100.00% (15/15) 100.00% (17/17) 100.00% (3/3) 100.00% (6/6)
src/L2StakeManager.sol 75.00% (6/8) 75.00% (12/16) 33.33% (1/3) 80.00% (4/5)
src/RewardDistributor.sol 76.09% (35/46) 69.70% (46/66) 9.09% (1/11) 80.00% (8/10)
Total 86.46% (83/96) 81.54% (106/130) 31.58% (6/19) 75.86% (22/29)

/// @notice Sets the flashblock index
/// @dev Only a builder can set the flashblock index
/// @param _flashblockIndex The new flashblock index
function setFlashblockIndex(uint8 _flashblockIndex) external onlyBuilder {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we include some basic verification here just to be safe? A simple version would be one where you can only increment by one or reset to zero (which should also require that the block number has increased by one), or a more sophisticated version would allow the owner to update a flashblocks-per-block variable and then that gets stepped through.

I would just worry as an app dev about relying on the builder to always operate with perfect accuracy, particularly if my application was counting on the "flashblocks always increase" invariant

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if they do operate with perfect accuracy, it's a great way to communicate the intended behavior

@marktoda marktoda force-pushed the add-builder-system-transactions branch from 3c8bc8c to 9a0bbce Compare March 14, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants